﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BirthdayNote
{

    public partial class Results : Form
    {
        /// <summary>
        /// 窗体构造函数
        /// </summary>
        /// <param name="nextBirthday">下一次生日的日期</param>
        /// <param name="difference">下一次生日距今天数</param>
        /// <param name="n">用户指定的生日前天数</param>
        /// <param name="beforeNDays">下一次生日前n天的日期</param>
        /// <param name="planDay">预计准备指定生日计划的日期</param>
        DateTime planDate;
        public Results(DateTime nextBirthday, int difference, int n, DateTime beforeNDays, DateTime planDay)
        {
            InitializeComponent();

            nextBirth.Text += $"{nextBirthday.ToString("yyyy-MM-dd")}";
            diff.Text += $"{difference}";
            beforeN.Text = $"距离下次生日前 {n} 天的日期：{beforeNDays.ToString("yyyy-MM-dd")}";
            planD.Text += $"{planDay.ToString("yyyy-MM-dd")}";
            planDate = planDay;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            End end = new End(planDate);
            end.Show();
        }
    }
}
